package com.dd.ent.car.common.util;

import java.text.DecimalFormat;

/**
 * Created by dengqu on 17/10/8.
 */

public class NumberUtil {
    /**
     * 格式化点赞数、播放数
     *
     * @param count
     * @return
     */
    public static String formatCount(long count) {
        if (count >= 10000) {
            DecimalFormat df = new DecimalFormat("#.0");
            float likeCountFloat = (float) count / 10000;
            String likeCountStr = df.format(likeCountFloat);
            if (likeCountStr.charAt(likeCountStr.length() - 1) == '0')
                likeCountStr = likeCountStr.substring(0, likeCountStr.length() - 2);
            return likeCountStr + "万";
        }
        return String.valueOf(count);
    }
}
